using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter20
{
	/// <summary>
	/// Example07: Boiling Water
	/// Suppose 1.00 g of water vaporizes isobarically at atmospheric
	/// pressure (1.013 \times 10^5 Pa). Its volume in the liquid state
	/// is V_i = V_{liquid} = 1.00 cm^3, and its volume in the vapor
	/// state is V_f = V_{vapor} = 1671 cm^3. Find the work done in the
	/// expansion and the change in internal energy of the system.
	/// Ignore any mixing of the steam and the surrounding air - 
	/// imagine that the steam simply pushes the surrounding air
	/// out of the way.
	/// W = - 169 J
	/// \Delta E_{int} = 2.09 kJ
	/// </summary>
	public class Example07
	{
		public Example07()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Work W = new L.Work();
			W.J = - 1.013E5*(1671.0E-6 - 1.0E-6);
			result+=Convert.ToString(W.J)+"\r\n";  
			L.Energy U = new L.Energy();
			U.VariableQ = true;
			L.Mass m = new L.Mass();
			m.kg = 1.0E-3;
			L.LatentHeat lh = new L.LatentHeat();
			lh.JPERkg = 2.26E6;
			L.Heat Q = new L.Heat(m,lh);
			L.FundamentalLaw.ThermodynamicsFirstLaw(Q,W,U);
			result+=Convert.ToString(U.J)+"\r\n";    
			
		}
	}
}
